<template>
	<view class="box">
		<view class="navBox">
			<fui-tabs :tabs="tabs" @change="tabChange" :current="tabIndex" :sliderBackground="'#FFDD00'"
				:selectedColor="'#000'" :size="24"" :short=" false" background="none" />
		</view>
		<view class="listBox">
			<swiper :current="tabIndex" :duration="300" @change="tabChange" class="swiper">
				<swiper-item class="fui-swiper__item" v-for="(res,inx) in tabs" :key="inx">
					<scroll-view scroll-y :show-scrollbar="false" class="swiper">
						<view class="" style="padding-bottom: 30rpx;">
							<view class="userboxs" v-for="i in 10" :key="i" @click="toDetails">
								<view class="userbox">
									<view class="flex">
										<view class="avatar">
											<image src="../../static/indexad/dy.png" mode=""></image>
										</view>
										<view style="margin-left:20rpx;">
											<view style="color:#000;font-size:26rpx;">单身美女</view>
											<view style="color:#999;font-size:22rpx;">主播・模特・演员</view>
										</view>
									</view>
									<view style="font-size:18rpx;color:#CCC">
										400米・在线
									</view>
								</view>
								<!-- 招聘内容 -->
								<view class="">
									<view class="flex" style="justify-content: space-between;padding: 20rpx 0rpx;">
										<view class="" style="font-weight: 700;">
											一起去打球吧
										</view>
										<view class="">
											江苏省南京市
										</view>
									</view>
									<view class="" style="font-size: 28rpx; color:#959595 ;padding-bottom: 20rpx;">
										喜欢汉服的小姐姐可以来聊，独家私密园林环境(人少不打扰适合创作)和拍摄服务，可以车接车送。小姐姐可以自备服装也可我这提供服装。(自带妆造或付费妆造)
									</view>
								</view>
								<!-- 			<view class="userPhotos">
				<view class="photo" v-for="i in 3" :key="i">
					<image src="/static/test/userheader.jpg" mode="aspectFit"></image>
				</view>
			</view> -->
								<view class="flex numMsg">
									<view class="">
										<text style="margin-right: 20rpx;">2天前</text> <text>联系0</text>
									</view>
									<view class="">
										查看5
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabIndex: 0,
				tabs: [
					'待审核',
					'展示中'
				],
			};
		},
		destroyed() {
			console.log('beforeDestroy');
			// this.list.map(v => {
			// 	let video = uni.createVideoContext(v.id, this);
			// 	video.seek(1);
			// 	video.pause();
			// })
		},
		methods: {
			tabChange(e) {
				if (e.name) {
					this.switchTab(e.index);
				} else {
					if (e.detail.source == 'touch') {
						let index = e.target.current || e.detail.current;
						this.switchTab(index);
					}
				}

			},
			switchTab(index) {
				if (this.tabIndex === index) return;
				this.tabIndex = index;
			},
			toDetails() {
				uni.navigateTo({
					url: '/releasePages/activity/details'
				})
			},

			goDynamicDetails() {
				if (this.tabIndex != 0) {
					uni.navigateTo({
						url: '/indexPages/BroadcastPage'
					});
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	view {
		box-sizing: border-box;
	}

	.listBox {
		height: calc(100vh - 100rpx);
	}

	.swiper {
		height: 100%;
	}

	.navBox {
		height: 100rpx;
		background-color: white;
	}

	.userboxs {
		border-radius: 10rpx;
		padding: 20rpx;
		background-color: white;
		margin-bottom: 20rpx;
	}

	.userbox {
		min-height: 100rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.numMsg {
		justify-content: space-between;
		border-top: 1rpx solid #eeeeee;
		padding: 10rpx 0rpx;
		font-size: 28rpx;
	}

	.userPhotos {

		display: flex;
		align-items: center;
		flex-wrap: wrap;
		padding: 20rpx 0rpx;
	}

	.photo {
		width: 210rpx;
		height: 210rpx;
		background-color: #CCC;
		border-radius: 10rpx;
		margin-right: 10rpx;
		margin-bottom: 10rpx;

		image {
			border-radius: 10rpx;
			width: 100% !important;
			height: 100% !important;
		}
	}

	.avatar {
		width: 90rpx;
		height: 90rpx;
		border-radius: 100%;

		image {
			width: 90rpx;
			height: 90rpx;
			border-radius: 100%;
		}
	}
</style>